package com.base.cn.platform.os.controller.qa.qaattend;

import com.base.cn.platform.os.common.AdminBaseController;
import com.base.cn.platform.os.service.course.qa.qaattend.QaAttendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author LIZHIPENG
 * @since 2018/4/28
 */
@Controller
@RequestMapping("/admin/qa/attend")
public class AdminQaAttendController extends AdminBaseController {

    @Autowired
    private QaAttendService qaAttendService;
    /**
     * 加载问题旁听列表
     * @param model
     * @param params
     * @return
     */
    @RequestMapping("/ajaxQueryQaAttendList")
    public String ajaxQueryQaAttendList(Model model,
                                        @RequestParam(value = "currentPage", required = false, defaultValue = "1")int currentPage,
                                        @RequestBody Map<String, Object> params){
        Map<String, Object> dataMap = qaAttendService.findQaAttendListPage(currentPage, 10, params, true);
        model.addAttribute("dataMap", dataMap);
        return resultPage("/qa/qaattend/ajax-attend");
    }
}
